﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace AspDotNet.Framework.Review.views.controls
{
    public class CustomButton : System.Web.UI.WebControls.Button
    {
        //重写Button基类的Click方法
        protected override void OnClick(EventArgs e)
        {
            base.OnClick(e);
            //随机改变按钮的背景色
            Random r = new Random();
            int red = r.Next(0, 255);
            int green = r.Next(0, 255);
            int blue = r.Next(0, 255);
            this.BackColor = System.Drawing.Color.FromArgb(red, green, blue);
        }
    }
}